package com.bigknow.appstore.common.rpc;

public enum MuxAction {

    MAIN("0001"), ESB_PROXY("0002"), DESIGNER_PROXY("0003");

    private String code;

    MuxAction(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public static MuxAction fromCode(String code) {
        for (MuxAction action : MuxAction.values()) {
            if (action.getCode().equals(code)) {
                return action;
            }
        }
        throw new IllegalArgumentException(String.format("Mux action unsupported(%s)", code));
    }
}